//
//  WTFocusService.m
//  WTLiveSDKDemo
//
//  Created by ben on 16/10/7.
//  Copyright © 2016年 ben. All rights reserved.
//

#import "WTFocusService.h"

@implementation WTFocusService

- (void)start:(NSDictionary *)param completionHandler:(WTServiceCompletionHandler)completionHandler{
    
    self.subPath = @"/private/isfocus";
    self.param = param;
    
    [HYBNetworking postWithUrl:self.subPath refreshCache:YES params:@{@"hash":[self encode]} success:^(id response) {
        
        NSInteger code = [response[@"code"] integerValue];
        if(code == 200){
            NSInteger statusCode = [response[@"hash"][@"StatusCode"] integerValue];
            NSInteger is_focus = [response[@"hash"][@"Remark"] integerValue];
            if(statusCode == 6){
                completionHandler(@[@(is_focus),@(YES)],nil);
            }else {
                completionHandler(@[@(is_focus),@(NO)],nil);
            }
        }else {
            completionHandler(nil,nil);
        }
        
    } fail:^(NSError *error) {
        completionHandler(nil,error);
    }];
}
@end
